<template>
  <div style="width: 80%;margin-left: 10%">
   <div style="text-align: center;margin-bottom: 50px">
     <h1>-----------{{this.name}} 网上信访受理查询入口</h1>
   </div>
    <h3 style="margin-left: 150px">投诉/建议事项</h3>
    <Divider />
    <div>
      <template>
        <Form :model="formItem" :label-width="80">
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">事项类别：</Col>
            <Col span="12" class="ivu-form-item-content">
              <RadioGroup v-model="formItem.type" type="button">
                <Radio label="0">网上投诉</Radio>
                <Radio label="1">网上建议</Radio>
              </RadioGroup>
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">标题：</Col>
            <Col span="11" class="ivu-form-item-content">
              <Input v-model="formItem.tittle"></Input>
              请用一句话概括您要投诉或建议的内容.
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">问题类型：</Col>
            <Col span="11" class="ivu-form-item-content">
              <Select v-model="formItem.wtType" >
                <Option value="0">请选择</Option>
                <Option value="1">不确定</Option>
                <Option value="2">农村农业</Option>
                <Option value="3">国土资源</Option>
                <Option value="0">城乡建设</Option>
                <Option value="1">劳动和社会保障</Option>
                <Option value="2">卫生计生</Option>
                <Option value="3">教育文体</Option>
                <Option value="0">民政</Option>
                <Option value="1">政法</Option>
                <Option value="2">经济管理</Option>
                <Option value="3">交通运输</Option>
                <Option value="0">商贸旅游</Option>
                <Option value="1">科技与信息产业</Option>
                <Option value="2">环境保护</Option>
                <Option value="3">政务党务</Option>
                <Option value="2">组织人事</Option>
                <Option value="3">纪检监督</Option>
              </Select>
              请选择投诉问题的类别.
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">问题发生地：</Col>
            <Col span="11">
              <Select v-model="formItem.sheng"  disabled>
                <Option value="0">辽宁省</Option>
              </Select>
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label"></Col>
            <Col span="11">
              <Select v-model="formItem.shi" disabled>
                <Option value="0">沈阳市</Option>
              </Select>
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label"></Col>
            <Col span="11">
              <Input v-model="formItem.qu" disabled></Input>
              请选择问题发生地所在城市和区县.
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">诉求内容：</Col>
            <Col span="11" class="ivu-form-item-content">
              <Input v-model="formItem.body" type="textarea" :autosize="{minRows: 5,maxRows: 4}"></Input>
              请输入诉求内容，2000字以内.
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">是否投诉代理：</Col>
            <Col span="12" class="ivu-form-item-content">
              <RadioGroup v-model="formItem.daili">
                <Radio label="1">是</Radio>
                <Radio label="0">否</Radio>
              </RadioGroup>
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">附件：</Col>
            <Col span="12">
              <template>
                <Upload action="//jsonplaceholder.typicode.com/posts/">
                  <Button icon="ios-cloud-upload-outline">上传</Button>
                </Upload>
              </template>
              您可以上传相关附件文件，每个文件的大小不能大于2M. 文件类型可以是图片，
              PDF、Word、Excel文档.
            </Col>
          </Row>
        </Form>
      </template>
    </div>
    <h3 style="margin-left: 150px">诉求人信息</h3>
    <Divider />
    <div>
      <template>
        <Form :model="formItem1" :label-width="80">
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">真实姓名：</Col>
            <Col span="11" class="ivu-form-item-content">
              <Input v-model="formItem1.name"></Input>
              请输入真实姓名.
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">证件类型：</Col>
            <Col span="11">
              <Select v-model="formItem1.cardType">
                <Option value="0">请选择</Option>
                <Option value="1">居民身份证</Option>
                <Option value="2">军官证</Option>
                <Option value="3">士官证</Option>
                <Option value="0">港澳台居民身份证</Option>
                <Option value="1">护照</Option>
              </Select>
              请选择证件类型.
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">证件号码：</Col>
            <Col span="11" class="ivu-form-item-content">
              <Input v-model="formItem1.idcard"></Input>
              请输入证件号码.
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">手机：</Col>
            <Col span="11" class="ivu-form-item-content">
              <Input v-model="formItem1.tel"></Input>
              请输入手机号码，以便我们反馈和联系..
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">验证码：</Col>
            <Col span="7" class="ivu-form-item-content">
              <Input v-model="formItem1.yanzhengma"></Input>
              请输入正确的短信验证码.
            </Col>
            <Col span="10">
              <Button type="primary" style="margin-left: 20px">获取验证码</Button>
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label">住址：</Col>
            <Col span="11">
              <Select v-model="formItem1.sheng">
                <Option value="0">辽宁省</Option>
              </Select>
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label"></Col>
            <Col span="11">
              <Select v-model="formItem1.shi">
                <Option value="0">沈阳市</Option>
              </Select>
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label"></Col>
            <Col span="11">
              <Select v-model="formItem1.qu">
                <Option value="13">请选择</Option>
                <Option value="0">沈河区</Option>
                <Option value="1">和平区</Option>
                <Option value="2">大东区</Option>
                <Option value="3">铁西区</Option>
                <Option value="4">浑南区</Option>
                <Option value="5">沈北新区</Option>
                <Option value="6">于洪区</Option>
                <Option value="7">皇姑区</Option>
                <Option value="8">苏家屯区</Option>
                <Option value="9">新民市</Option>
                <Option value="10">法库县</Option>
                <Option value="11">辽中县</Option>
                <Option value="12">康平县</Option>
              </Select>
            </Col>
          </Row>
          <Row class="bench_search">
            <Col span="7" class="ivu-form-item-label"></Col>
            <Col span="11" class="ivu-form-item-content">
              <Input v-model="formItem.address"></Input>
              请选择所在省、市、区县和填写详细地址.
            </Col>
          </Row>
          <Divider style="margin-top: 50px"/>
          <div style="text-align: center;margin-top: 50px">
            <Button type="error" @click="submit" style="margin-right: 50px" size="large">提交诉求</Button>
            <Button type="dashed" size="large" @click="fanhui">返回</Button>
          </div>
        </Form>
      </template>
    </div>
  </div>
</template>

<script>
import { getUpCompanyCode } from '@/api/activity'

export default {
  name: 'index',
  data () {
    return {
      code: '',
      urlcode: '',
      name: '',
      appeaAreaList1: [
        {
          tittle: 'LM00001',
          value: 'd6da07b9-9571-b42c-b97a-00a02a90de52'
        },
        {
          tittle: 'LM00002',
          value: 'e3fdd4fd-dbe4-648a-1965-966a1062217f'
        },
        {
          tittle: 'LM00003',
          value: 'ec2f95c4-4f04-d411-992f-5cff1f1f7d8e'
        },
        {
          tittle: 'LM00004',
          value: '7e87ac96-658e-e4ab-0841-53560316a64e'
        },
        {
          tittle: 'LM00005',
          value: 'f1ee48cb-be2a-a4c1-cb54-4636333ad969'
        },
        {
          tittle: 'LM00007',
          value: '4ce55747-7eec-7400-0b2d-56222516bbcb'
        },
        {
          tittle: 'LM00006',
          value: 'e9ca80de-e4c0-f4ac-c8e4-26ca94ae4409'
        },
        {
          tittle: 'LM00008',
          value: '88b7c751-1885-049d-292b-1c3b2deab137'
        },
        {
          tittle: 'LM00009',
          value: '77af4229-9926-d486-aa5c-73a5ecdf1607'
        },
        {
          tittle: 'LM00013',
          value: '5dce9df9-9e0f-c474-b8d9-8bd38fc892c7'
        },
        {
          tittle: 'LM00012',
          value: '976b65cc-c451-34e4-f9a3-1051d77be14e'
        },
        {
          tittle: 'LM00010',
          value: 'c77df7ae-e590-5405-49e9-74a253227cfe'
        },
        {
          tittle: 'LM00011',
          value: 'bda153fd-d133-4455-a814-719d94c03a5f'
        }
      ],
      formItem: {
        sheng: '0',
        shi: '0',
        qu: '',
        wtType: '1'
      },
      formItem1: {
        sheng: '0',
        shi: '0',
        cardType: '1',
        qu: '13'
      }
    }
  },
  mounted () {
    this.init()
  },
  methods: {
    fanhui () {
      this.$router.push({
        path: '/mainv3'
      })
    },
    submit () {
      this.$Notice.success({ title: '成功', desc: '推送成功' })
      this.$router.push({
        path: '/mainv3'
      })
    },
    init () {
      getUpCompanyCode().then(ret => {
        if (ret.data.errcode === 0) {
          this.code = ret.data.data.company_code
          this.name = ret.data.data.city
          this.formItem.qu = ret.data.data.city
          // this.appeal()
        } else {
          // console.log(123132)
          this.$Notice.error({ title: '查询失败', desc: ret.data.errmsg })
          this.$router.push({
            path: '/mainv3'
          })
        }
      })
    },
    appeal () {
      var url = 'http://sy.lnxf.gov.cn/Home/EventCenter2?currRegionId='
      this.appeaAreaList1.forEach((item, index) => {
        if (this.code === item.tittle) {
          this.urlcode = item.value
        }
      })
      window.open(url + this.urlcode)
      this.$router.push({
        path: '/mainv3'
      })
    }
  }
}
</script>

<style scoped>
  .bench_search {
    margin-bottom: 10px;
  }
</style>
